package com.example.demo.ai.llm.controller;

import com.example.demo.ai.llm.service.RepositoryService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import java.util.List;
import org.noear.solon.annotation.*;

/**
 * @author airhead
 */
@Controller
@Mapping("/repository")
@Api("知识库")
public class RepositoryController {
  @Inject private RepositoryService service;

  @ApiOperation("addDoc")
  @Post
  @Mapping("addDoc")
  public Boolean addDoc(String content) {
    return service.addDoc(content);
  }

  @ApiOperation("search")
  @Post
  @Mapping("search")
  public List<String> search(String query) {
    return service.search(query);
  }
}
